import html
import json
import re

from django.http import HttpResponse
from django.shortcuts import render

# Create your views here.

from django.contrib.auth.views import LoginView
from django.urls import reverse
from django.views import View

from apps import adminz

def remove_control_characters(text):
    # 定义一个正则表达式来匹配控制字符
    control_chars = re.compile(r'[\x00-\x1F\x7F]+', re.UNICODE)
    # 使用 sub 方法将匹配到的控制字符替换为空字符串
    cleaned_text = control_chars.sub('', text)
    return cleaned_text
class BatchView(View):
        
    def get(self, request, *args, **kwargs):
        pass

    def post(self, request, *args, **kwargs):
        # 获取POST数据

        data = json.loads(request.body.decode('utf-8'))

        print(data)

        return HttpResponse('success')


class SshSecretFree(View):

    def get(self, request, *args, **kwargs):
        pass

    def post(self, request, *args, **kwargs):
        data = json.loads(request.body.decode('utf-8'))

        print(data)

        return HttpResponse('success')




